package com.loveprogrammer.eternity.model.mission.support;

import com.loveprogrammer.eternity.model.game.HeroWrapper;
import com.loveprogrammer.eternity.model.mission.MissionAction;
import com.loveprogrammer.eternity.model.mission.MissionDefinition;
import com.loveprogrammer.eternity.model.mission.MissionReward;
import com.loveprogrammer.eternity.model.product.equipment.Equips;
import lombok.Data;

/**
 * @version 1.0.0
 * @description: 穿戴装备
 * @author: eric
 * @date: 2023-01-05 14:18
 **/
@Data
public class WearEquipmentMission extends MissionDefinition {

    /***
     * 共戴几件装备
     */
    private int goal;

    public WearEquipmentMission(int goal, Integer taskTargetType, MissionReward reward) {
        super(taskTargetType, reward);
        this.goal = goal;
    }

    public WearEquipmentMission(String taskId, Integer progress, long createTime, Integer taskTargetType, MissionReward reward, int goal) {
        super(taskId, progress, createTime, taskTargetType, reward);
        this.goal = goal;
    }

    @Override
    protected void doUpdate(HeroWrapper hero, MissionAction action) {




    }

    @Override
    public boolean checkTaskComplete(HeroWrapper hero) {
        Equips equips = hero.getHero().getEquips();
        if(equips.getAll().size() >= goal) {
            return true;
        }
        return false;
    }
}
